<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__opamp.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Opamp (Operational Amplifier)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with the Operational Amplifier (Opamp). </p>
<h1><a class="anchor" id="cyhal_opamp_features"></a>
Features</h1>
<p >Each opamp can operate in one of two modes:</p><ul>
<li>Opamp: Bare opamp with two input pins.</li>
<li>Follower: Also known as unity gain. Buffers the signal on a single input pin and drives the same voltage on the output.</li>
</ul>
<p >In both modes, the output is driven off chip via another pin.</p>
<h1><a class="anchor" id="cyhal_opamp_quickstart"></a>
Quickstart</h1>
<p >Call <a class="el" href="group__group__hal__opamp.html#ga541bc16bacffaddecbc3af24bfb77256">cyhal_opamp_init</a> to initialize an opamp instance by providing the opamp object (<b>obj</b>), non-inverting input pin (<b>vin_p</b>), inverting input pin (<b>vin_m</b>), and output pin (<b>vout</b>). If follower mode is desired, pass <code>NC</code> for <b>vin_m</b>.</p>
<p >Use <a class="el" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a> to configure the opamp power.</p>
<h1><a class="anchor" id="subsection_opamp_snippets"></a>
Code Snippets</h1>
<dl class="section note"><dt>Note</dt><dd>Error checking is omitted for clarity </dd></dl>
<h1><a class="anchor" id="subsection_opamp_snippet_1"></a>
Snippet 1: Bare opamp initialization</h1>
<p >The following snippet initializes a bare opamp. Note that any passive components (e.g. resistive feedback) must be implemented off-chip. </p><div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>     rslt;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> opamp_obj;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize opamp, using pin PIN_VINP for the non-inverting input, pin PIN_VINM for the</span></div>
<div class="line">    <span class="comment">// inverting input, and PIN_VOUT for the output</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga541bc16bacffaddecbc3af24bfb77256">cyhal_opamp_init</a>(&amp;opamp_obj, PIN_VINP, PIN_VINM, PIN_VOUT);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Power on the opamp</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a>(&amp;opamp_obj, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a6f0f4df45e9cac012a2c8e5ba736241b">CYHAL_POWER_LEVEL_DEFAULT</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Release opamp object after use</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__opamp.html#gae1ed8b252f2b7415021984996826a52b">cyhal_opamp_free</a>(&amp;opamp_obj);</div>
<div class="ttc" id="agroup__group__hal__general__types_html_gga246fde0e79029f514ce3846b31e366d7a6f0f4df45e9cac012a2c8e5ba736241b"><div class="ttname"><a href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a6f0f4df45e9cac012a2c8e5ba736241b">CYHAL_POWER_LEVEL_DEFAULT</a></div><div class="ttdeci">@ CYHAL_POWER_LEVEL_DEFAULT</div><div class="ttdoc">Default comparator power and speed.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:154</div></div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__opamp__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a></div><div class="ttdoc">OPAMP object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:680</div></div>
<div class="ttc" id="agroup__group__hal__opamp_html_ga3d5784bf2463ccdb9c80a2a02d100f8a"><div class="ttname"><a href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a></div><div class="ttdeci">cy_rslt_t cyhal_opamp_set_power(cyhal_opamp_t *obj, cyhal_power_level_t power)</div><div class="ttdoc">Changes the current operating power level of the opamp.</div></div>
<div class="ttc" id="agroup__group__hal__opamp_html_ga541bc16bacffaddecbc3af24bfb77256"><div class="ttname"><a href="group__group__hal__opamp.html#ga541bc16bacffaddecbc3af24bfb77256">cyhal_opamp_init</a></div><div class="ttdeci">cy_rslt_t cyhal_opamp_init(cyhal_opamp_t *obj, cyhal_gpio_t vin_p, cyhal_gpio_t vin_m, cyhal_gpio_t vout)</div><div class="ttdoc">Initialize the opamp peripheral.</div></div>
<div class="ttc" id="agroup__group__hal__opamp_html_gae1ed8b252f2b7415021984996826a52b"><div class="ttname"><a href="group__group__hal__opamp.html#gae1ed8b252f2b7415021984996826a52b">cyhal_opamp_free</a></div><div class="ttdeci">void cyhal_opamp_free(cyhal_opamp_t *obj)</div><div class="ttdoc">Deinitialize the opamp peripheral and free associated resources.</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
</div><!-- fragment --> <h1><a class="anchor" id="subsection_opamp_snippet_2"></a>
Snippet 2: Opamp follower initialization</h1>
<p >The following snippet initializes an opamp as a follower. </p><div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>     rslt;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> opamp_obj;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize opamp as follower, using pin PIN_VINP for the input and PIN_VOUT for the output</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga541bc16bacffaddecbc3af24bfb77256">cyhal_opamp_init</a>(&amp;opamp_obj, PIN_VINP, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a>, PIN_VOUT);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Power on the opamp</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a>(&amp;opamp_obj, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a6f0f4df45e9cac012a2c8e5ba736241b">CYHAL_POWER_LEVEL_DEFAULT</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Release opamp object after use</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__opamp.html#gae1ed8b252f2b7415021984996826a52b">cyhal_opamp_free</a>(&amp;opamp_obj);</div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a></div><div class="ttdeci">@ NC</div><div class="ttdoc">No Connect/Invalid Pin.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:53</div></div>
</div><!-- fragment --> <h1><a class="anchor" id="subsection_opamp_snippet_3"></a>
Snippet 3: Opamp powering-off and on</h1>
<p >The following snippet demonstrates temporarily powering-off the opamp without freeing it. </p><div class="fragment"><div class="line"> </div>
<div class="line">    <span class="comment">// This assumes that the opamp has already been initialized as shown in snippet 1 or 2</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Power on the opamp</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a>(&amp;opamp_obj, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a6f0f4df45e9cac012a2c8e5ba736241b">CYHAL_POWER_LEVEL_DEFAULT</a>);</div>
<div class="line"> </div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a>(&amp;opamp_obj, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a0f601c5d5843c59e58ee1988dd0e6861">CYHAL_POWER_LEVEL_OFF</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// When the opamp is needed again, power it back on</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a>(&amp;opamp_obj, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a6f0f4df45e9cac012a2c8e5ba736241b">CYHAL_POWER_LEVEL_DEFAULT</a>);</div>
<div class="ttc" id="agroup__group__hal__general__types_html_gga246fde0e79029f514ce3846b31e366d7a0f601c5d5843c59e58ee1988dd0e6861"><div class="ttname"><a href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a0f601c5d5843c59e58ee1988dd0e6861">CYHAL_POWER_LEVEL_OFF</a></div><div class="ttdeci">@ CYHAL_POWER_LEVEL_OFF</div><div class="ttdoc">Power-off the comparator, while retaining configuration.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:146</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__opamp"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__opamp.html">Opamp HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__opamp"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opamp specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga541bc16bacffaddecbc3af24bfb77256"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__opamp.html#ga541bc16bacffaddecbc3af24bfb77256">cyhal_opamp_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *obj, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> vin_p, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> vin_m, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> vout)</td></tr>
<tr class="memdesc:ga541bc16bacffaddecbc3af24bfb77256"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the opamp peripheral.  <a href="group__group__hal__opamp.html#ga541bc16bacffaddecbc3af24bfb77256">More...</a><br /></td></tr>
<tr class="separator:ga541bc16bacffaddecbc3af24bfb77256"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga52cc0341b0cf6d3fb9f1cb7c2a46fbed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__opamp.html#ga52cc0341b0cf6d3fb9f1cb7c2a46fbed">cyhal_opamp_init_cfg</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *obj, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__configurator__t">cyhal_opamp_configurator_t</a> *cfg)</td></tr>
<tr class="memdesc:ga52cc0341b0cf6d3fb9f1cb7c2a46fbed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the opamp peripheral using a configurator generated configuration struct.  <a href="group__group__hal__opamp.html#ga52cc0341b0cf6d3fb9f1cb7c2a46fbed">More...</a><br /></td></tr>
<tr class="separator:ga52cc0341b0cf6d3fb9f1cb7c2a46fbed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae1ed8b252f2b7415021984996826a52b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__opamp.html#gae1ed8b252f2b7415021984996826a52b">cyhal_opamp_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *obj)</td></tr>
<tr class="memdesc:gae1ed8b252f2b7415021984996826a52b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize the opamp peripheral and free associated resources.  <a href="group__group__hal__opamp.html#gae1ed8b252f2b7415021984996826a52b">More...</a><br /></td></tr>
<tr class="separator:gae1ed8b252f2b7415021984996826a52b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d5784bf2463ccdb9c80a2a02d100f8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *obj, <a class="el" href="group__group__hal__general__types.html#ga246fde0e79029f514ce3846b31e366d7">cyhal_power_level_t</a> power)</td></tr>
<tr class="memdesc:ga3d5784bf2463ccdb9c80a2a02d100f8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the current operating power level of the opamp.  <a href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">More...</a><br /></td></tr>
<tr class="separator:ga3d5784bf2463ccdb9c80a2a02d100f8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga541bc16bacffaddecbc3af24bfb77256" name="ga541bc16bacffaddecbc3af24bfb77256"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga541bc16bacffaddecbc3af24bfb77256">&#9670;&nbsp;</a></span>cyhal_opamp_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_opamp_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>vin_p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>vin_m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>vout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the opamp peripheral. </p>
<p >If vin_m is <a class="el" href="group__group__hal__impl__pin__package__xmc7200__320__bga.html#ggad38839a2406ac562d708d7639fbff225a3dbd1016ea99d087d747530418b89a01">NC</a>, the opamp will be initialized in follower mode (unity gain).</p>
<p >The opamp will be initialized but not powered-on until <a class="el" href="group__group__hal__opamp.html#ga3d5784bf2463ccdb9c80a2a02d100f8a">cyhal_opamp_set_power</a> is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an opamp object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">vin_p</td><td>Non-inverting input </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">vin_m</td><td>Inverting input </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">vout</td><td>opamp output </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga52cc0341b0cf6d3fb9f1cb7c2a46fbed" name="ga52cc0341b0cf6d3fb9f1cb7c2a46fbed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga52cc0341b0cf6d3fb9f1cb7c2a46fbed">&#9670;&nbsp;</a></span>cyhal_opamp_init_cfg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_opamp_init_cfg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__configurator__t">cyhal_opamp_configurator_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the opamp peripheral using a configurator generated configuration struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an opamp object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration structure generated by a configurator. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="gae1ed8b252f2b7415021984996826a52b" name="gae1ed8b252f2b7415021984996826a52b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae1ed8b252f2b7415021984996826a52b">&#9670;&nbsp;</a></span>cyhal_opamp_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_opamp_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize the opamp peripheral and free associated resources. </p>
<p >This will disconnect all inputs and outputs, including internal feedback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The opamp object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3d5784bf2463ccdb9c80a2a02d100f8a" name="ga3d5784bf2463ccdb9c80a2a02d100f8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d5784bf2463ccdb9c80a2a02d100f8a">&#9670;&nbsp;</a></span>cyhal_opamp_set_power()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_opamp_set_power </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__opamp__t">cyhal_opamp_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__general__types.html#ga246fde0e79029f514ce3846b31e366d7">cyhal_power_level_t</a>&#160;</td>
          <td class="paramname"><em>power</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Changes the current operating power level of the opamp. </p>
<p >If the power level is set to <a class="el" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a0f601c5d5843c59e58ee1988dd0e6861">CYHAL_POWER_LEVEL_OFF</a>, the opamp will be powered-off but it will retain its configuration, so it is not necessary to reconfigure it when changing the power level from <a class="el" href="group__group__hal__general__types.html#gga246fde0e79029f514ce3846b31e366d7a0f601c5d5843c59e58ee1988dd0e6861">CYHAL_POWER_LEVEL_OFF</a> to any other value.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Opamp object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">power</td><td>The power level to set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set power request </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
